package com.cx.caigou.config;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateTimeString {
    public static Date toDateTime(String strDate){
        //strDate = strDate.replaceAll("T"," ");
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");

        Date dateTime = null;
        try {
            dateTime = format.parse(strDate);
            String date = format.format(dateTime);//转string
        } catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return dateTime;
    }
}
